/*
 * =====================================================================================
 *
 *       Filename:  PacketQueue.h
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  04/16/2015 02:12:30 PM
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Dellinger.Zhang (mn), rainxy2000@hotmail.com
 *        Company:  TD studio
 *
 * =====================================================================================
 */

#ifndef __PACKETQUEUE_H__
#define __PACKETQUEUE_H__

#include <queue>
#include "UDPPacket.h"
#include "ct_semaphore.h"
#include "ct_mutex.h"

class PacketQueue {
	public:
		PacketQueue();
		virtual ~PacketQueue();

	public:
		void initPool(const int PoolNum);
		void freePool();
		void connectCheck();
		void push(UDPPacket *pack);
		UDPPacket* pop();

	private:
		mutable ctMutex			mutex_;
		std::queue<UDPPacket*>	queue_;
};

#endif //__PACKETQUEUE_H__

